package com.two.service.restaurant.controller.api;


import com.two.common.util.CommonResult;
import com.two.common.vo.RestaurantVo;
import com.two.service.restaurant.service.RestaurantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/restaurant/restaurant")
public class ApiRestaurantController {

    @Autowired
    private RestaurantService restaurantService;

    //查询所有餐厅
    @PostMapping("/selectAll")
    public CommonResult selectAll(){
        return restaurantService.selectAll();
    }

    //添加新入驻的餐厅信息
    @PostMapping("/addRestaurant")
    public Integer addRestaurant(@RequestBody RestaurantVo restaurantVo){
        return restaurantService.addRestaurant(restaurantVo);
    }
}
